Add a script for porting passes tests to lit - #3963
Conversation
And use it to port the very simple untee test.
| parser.add_argument('--git-add', action='store_true', | ||
| help='Stage changes') | ||
| parser.add_argument('tests', nargs='+', help='The test files to port') | ||
| args = parser.parse_args() |
There was a problem hiding this comment.
It'd be good to add simple --help with a usage string
There was a problem hiding this comment.
This is automatically generated by the arg parser module!
| opts = [('--' + p if not p.startswith('O') and p != 'g' else '-' + p) | ||
| for p in passes] | ||
|
|
||
| run_line = (f';; RUN: foreach %s %t wasm-opt {" ".join(opts)} -S -o -' |
| if args.git_add: | ||
| subprocess.run(['git', 'add', f]) |
There was a problem hiding this comment.
This stages the removal of the file.
|
I fixed the flake8 error and added a new note to be emitted into the ported test identifying it as automatically ported. I realized this actually depends on #3962, so I will wait for that to land before re-generating the test here and landing this. |
| @@ -0,0 +1,110 @@ | |||
| #!/usr/bin/env python3 | |||
| subprocess.run(['git', 'add', f]) | ||
|
|
||
| if args.git_add: | ||
| subprocess.run(['git', 'add', dest]) |
There was a problem hiding this comment.
I'm surprised to see the git operations here... I'd expect the user to run them manually. But I don't feel strongly, if this is easier sgtm.
There was a problem hiding this comment.
Yep, it's a little weird to do this in the script, so I put it behind a flag. It's a great quality of life feature, though.
Using the script from WebAssembly#3963. Be careful to exclude metrics and fuzz-exec tests, which have output that is not captured by the check generator script.
Using the script from WebAssembly#3963. Be careful to exclude metrics and fuzz-exec tests, which have output that is not captured by the check generator script.
Using the script from WebAssembly#3963. Be careful to exclude metrics and fuzz-exec tests, which have output that is not captured by the check generator script.
Using the script from WebAssembly#3963. Be careful to exclude metrics and fuzz-exec tests, which have output that is not captured by the check generator script.
Using the script from WebAssembly#3963. Be careful to exclude metrics and fuzz-exec tests, which have output that is not captured by the check generator script.
Using the script from WebAssembly#3963. Be careful to exclude metrics and fuzz-exec tests, which have output that is not captured by the check generator script.
And use it to port the very simple untee test.